<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
      <el-form-item label="预算名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入预算名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="预算年度" prop="year">
        <el-date-picker
          v-model="queryParams.year"
          value-format="yyyy"
          type="year"
          @change="getList"
          placeholder="选择预算年度">
        </el-date-picker>
      </el-form-item>
      <!--       <el-form-item label="审核状态" prop="state">
               <el-select
                 v-model="queryParams.state"
                 clearable
                 placeholder="请选择审核状态"
                 style="width: 146px"
               >
                 <el-option
                   v-for="dict in budgetStatus"
                   :key="dict.dictValue"
                   :label="dict.dictLabel"
                   :value="dict.dictValue"
                 />
               </el-select>
             </el-form-item>-->
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="success"
          size="mini"
          :disabled="multiple"
          @click="handleCheck"
          v-hasPermi="['budget:approval:add']"
        >
          <svg-icon class="svg" icon-class="examine"/>
          审核
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          size="mini"
          @click="handleBudget"
          :disabled="multiple"
          icon="el-icon-plus"
          v-hasPermi="['budget:budget:countyAdd']"
        >
          生成预算
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <!-- <div class="selectedDv" v-if="ids.length > 0">已选<span style="color:#1890FF;padding:  0 6px;">{{ ids.length }}</span>项
     </div>-->
    <el-table ref="multipleTable" v-loading="loading" :data="BudgetFundsList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" :selectable='checkboxT'/>
<!--            <el-table-column type="selection" width="55" align="center"/>-->
      <el-table-column fixed label="预算编号" min-width="200" align="center" prop="number"/>
      <el-table-column fixed label="预算单位" min-width="130" align="center" prop="deptName"/>
      <el-table-column label="预算名称" min-width="200" align="center" prop="name"/>
      <el-table-column label="预算年份" align="center" prop="year"/>
      <el-table-column label="面积（亩）" min-width="100" align="center" prop="zmj"/>
      <el-table-column label="预算金额（元）" min-width="130" align="center" prop="totalMoney">
        <template slot-scope="scope">
          <span>
           <!-- {{
              scope.row.totalMoney == 0 ? "-" : (String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.totalMoney).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.totalMoney).split('.')[1].length < 2 ? String(scope.row.totalMoney).split('.')[1] + '0' : String(scope.row.totalMoney).split('.')[1]))
            }}-->
           {{ (parseFloat(scope.row.statis.gytdprice)+parseFloat(scope.row.statis.jttdprice)+parseFloat(scope.row.statis.qmprice)+parseFloat(scope.row.statis.fswprice))==0?"-":String((parseFloat(scope.row.statis.gytdprice)+parseFloat(scope.row.statis.jttdprice)+parseFloat(scope.row.statis.qmprice)+parseFloat(scope.row.statis.fswprice)).toFixed(2)).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')+"."+String((parseFloat(scope.row.statis.gytdprice)+parseFloat(scope.row.statis.jttdprice)+parseFloat(scope.row.statis.qmprice)+parseFloat(scope.row.statis.fswprice)).toFixed(2)).split('.')[1]
            }}
    <!--        {{
              ((scope.row.statis.gytdprice==null||scope.row.statis.gytdprice==''?0:parseFloat(scope.row.statis.gytdprice))+ (scope.row.statis.jttdprice==null||scope.row.statis.jttdprice==''?0:parseFloat(scope.row.statis.jttdprice))+(scope.row.statis.qmprice==null||scope.row.statis.qmprice==''?0:parseFloat(scope.row.statis.qmprice))+(scope.row.statis.fswprice==null||scope.row.statis.fswprice==''?0:parseFloat(scope.row.statis.fswprice))) == 0 ? "-" : (String(((scope.row.statis.gytdprice==null||scope.row.statis.gytdprice==''?0:parseFloat(scope.row.statis.gytdprice))+ (scope.row.statis.jttdprice==null||scope.row.statis.jttdprice==''?0:parseFloat(scope.row.statis.jttdprice))+(scope.row.statis.qmprice==null||scope.row.statis.qmprice==''?0:parseFloat(scope.row.statis.qmprice))+(scope.row.statis.fswprice==null||scope.row.statis.fswprice==''?0:parseFloat(scope.row.statis.fswprice)))).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(((scope.row.statis.gytdprice==null||scope.row.statis.gytdprice==''?0:parseFloat(scope.row.statis.gytdprice))+ (scope.row.statis.jttdprice==null||scope.row.statis.jttdprice==''?0:parseFloat(scope.row.statis.jttdprice))+(scope.row.statis.qmprice==null||scope.row.statis.qmprice==''?0:parseFloat(scope.row.statis.qmprice))+(scope.row.statis.fswprice==null||scope.row.statis.fswprice==''?0:parseFloat(scope.row.statis.fswprice)))).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(((scope.row.statis.gytdprice==null||scope.row.statis.gytdprice==''?0:parseFloat(scope.row.statis.gytdprice))+ (scope.row.statis.jttdprice==null||scope.row.statis.jttdprice==''?0:parseFloat(scope.row.statis.jttdprice))+(scope.row.statis.qmprice==null||scope.row.statis.qmprice==''?0:parseFloat(scope.row.statis.qmprice))+(scope.row.statis.fswprice==null||scope.row.statis.fswprice==''?0:parseFloat(scope.row.statis.fswprice)))).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(((scope.row.statis.gytdprice==null||scope.row.statis.gytdprice==''?0:parseFloat(scope.row.statis.gytdprice))+ (scope.row.statis.jttdprice==null||scope.row.statis.jttdprice==''?0:parseFloat(scope.row.statis.jttdprice))+(scope.row.statis.qmprice==null||scope.row.statis.qmprice==''?0:parseFloat(scope.row.statis.qmprice))+(scope.row.statis.fswprice==null||scope.row.statis.fswprice==''?0:parseFloat(scope.row.statis.fswprice)))).split('.')[1].length < 2 ? String(((scope.row.statis.gytdprice==null||scope.row.statis.gytdprice==''?0:parseFloat(scope.row.statis.gytdprice))+ (scope.row.statis.jttdprice==null||scope.row.statis.jttdprice==''?0:parseFloat(scope.row.statis.jttdprice))+(scope.row.statis.qmprice==null||scope.row.statis.qmprice==''?0:parseFloat(scope.row.statis.qmprice))+(scope.row.statis.fswprice==null||scope.row.statis.fswprice==''?0:parseFloat(scope.row.statis.fswprice)))).split('.')[1] + '0' : String(((scope.row.statis.gytdprice==null||scope.row.statis.gytdprice==''?0:parseFloat(scope.row.statis.gytdprice))+ (scope.row.statis.jttdprice==null||scope.row.statis.jttdprice==''?0:parseFloat(scope.row.statis.jttdprice))+(scope.row.statis.qmprice==null||scope.row.statis.qmprice==''?0:parseFloat(scope.row.statis.qmprice))+(scope.row.statis.fswprice==null||scope.row.statis.fswprice==''?0:parseFloat(scope.row.statis.fswprice)))).split('.')[1]))
            }}-->
           </span>
        </template>
      </el-table-column>
      <!--      <el-table-column label="国有土地" align="center">
              <el-table-column
                align="center"
                prop="statis.gytdmj"
                label="面积（亩）"
                width="120">
                <template slot-scope="scope">
                  {{ scope.row.statis.gytdmj == 0 ? "-" : scope.row.statis.gytdmj }}
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="statis.gytdprice"
                label="金额（元）"
                width="120">
                <template slot-scope="scope">
                  <div>
                    {{
                      scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.gytdprice).split('.')[1].length < 2 ? String(scope.row.statis.gytdprice).split('.')[1] + '0' : String(scope.row.statis.gytdprice).split('.')[1]))
                    }}
                  </div>
                </template>
              </el-table-column>
            </el-table-column>
            <el-table-column label="集体土地" align="center">
              <el-table-column
                align="center"
                prop="statis.jttdmj"
                label="面积（亩）"
                width="120">
                <template slot-scope="scope">
                  <div>{{ scope.row.statis.jttdmj == 0 ? "-" : scope.row.statis.jttdmj }}
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="statis.jttdprice"
                label="金额（元）"
                width="120">
                <template slot-scope="scope">
                  <div>
                    {{
                      scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.jttdprice).split('.')[1].length < 2 ? String(scope.row.statis.jttdprice).split('.')[1] + '0' : String(scope.row.statis.jttdprice).split('.')[1]))
                    }}
                  </div>
                </template>
              </el-table-column>
            </el-table-column>
            <el-table-column label="附着物" align="center">
              <el-table-column
                align="center"
                prop="statis.qmmj"
                label="面积（亩）"
                width="120">
                <template slot-scope="scope">
                  <div>{{ scope.row.statis.qmmj == 0 ? "-" : scope.row.statis.qmmj }}
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="statis.qmprice"
                label="金额（元）"
                width="120">
                <template slot-scope="scope">
                  <div style="line-height: 23px; text-align: left;" v-show="scope.row.statis.qmprice !=0">
                    {{
                      scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                    }}
                  </div>
                </template>
              </el-table-column>
            </el-table-column>
            <el-table-column label="地上附属物" align="center">
              <el-table-column
                align="center"
                prop="statis.fswmj"
                label="面积（亩）"
                width="120">
                <template slot-scope="scope">
                  <div>{{ scope.row.statis.fswmj == 0 ? "-" : scope.row.statis.fswmj }}
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                align="center"
                prop="statis.fswprice"
                label="金额（元）"
                width="120">
                <template slot-scope="scope">
                  <div style="line-height: 23px; text-align: center;">
                    {{
                      scope.row.statis.fswprice == 0 || scope.row.statis.fswprice == "" ? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                    }}
                  </div>
                </template>
              </el-table-column>
            </el-table-column>-->
      <el-table-column label="地块数" min-width="80" align="center" prop="statis.dkzs"/>
      <el-table-column label="审核状态" min-width="90" align="center" prop="state">
        <template slot-scope="scope">
          <div class="statusDv">
            <div class="statudPoint" :class="'Bg'+scope.row['state']"></div>
            <div v-for="sta in budgetStatus" v-if="sta.dictValue == scope.row['state']">{{ sta.dictLabel }}</div>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="备注" min-width="270" align="center" prop="aa">
        <template slot-scope="scope">
          <div align="left" v-if="scope.row.statis.gytdmj!=null&&scope.row.statis.gytdmj!=''"> {{
              "国有土地 （面积：" + scope.row.statis.gytdmj + "金额：" +
              (scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.gytdprice).split('.')[1].length < 2 ? String(scope.row.statis.gytdprice).split('.')[1] + "0" : String(scope.row.statis.gytdprice).split('.')[1]))) + "）"
            }}
          </div>
          <div align="left" v-if="scope.row.statis.jttdmj!=null&&scope.row.statis.jttdmj!=''"> {{
              '集体土地 （面积：' + scope.row.statis.jttdmj + " 金额：" +
              (scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.jttdprice).split('.')[1].length < 2 ? String(scope.row.statis.jttdprice).split('.')[1] + '0' : String(scope.row.statis.jttdprice).split('.')[1]))) + "）"
            }}
          </div>
          <div align="left" v-if="scope.row.statis.qmmj!=null&&scope.row.statis.qmmj!=''"> {{
              '青 苗  （面积：' + scope.row.statis.qmmj + ' 金额：' +
              (scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.qmprice).split('.')[1].length < 2 ? String(scope.row.statis.qmprice).split('.')[1] + '0' : String(scope.row.statis.qmprice).split('.')[1]))) + "）"
            }}
          </div>
          <div align="left" v-if="scope.row.statis.fswmj!=null&&scope.row.statis.fswmj!=''"> {{
              '地上附属物  （面积：' + scope.row.statis.fswmj + ' 金额：' +
              (scope.row.statis.fswprice == 0 ? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.fswprice).split('.')[1].length < 2 ? String(scope.row.statis.fswprice).split('.')[1] + '0' : String(scope.row.statis.fswprice).split('.')[1]))) + "）"
            }}
          </div>
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
        <template slot-scope="scope">
          <el-button
            v-if="isReject&&scope.row.refuseVisable"
            size="mini"
            type="text"
            @click="handleCheckReject(scope.row)"
          >
            <svg-icon class="svg" icon-class="reject"/>
            驳回
          </el-button>
          <el-button
            v-if="scope.row.departmentCode.length<12"
            size="mini"
            type="text"
            @click="handleTabDetails(scope.row)"
          >
            <svg-icon class="svg" icon-class="details"/>
            预算明细
          </el-button>
          <el-button
            v-else
            size="mini"
            type="text"
            @click="handleTabCunDetails(scope.row)"
          >
            <svg-icon class="svg" icon-class="details"/>
            预算明细
          </el-button>
          <el-button
            v-if="scope.row.state!='1'"
            size="mini"
            type="text"
            @click="handleExamineRecord(scope.row)"
          >
            <svg-icon class="svg" icon-class="records"/>
            审核记录
          </el-button>
<!--          v-if="scope.row.state!='1'"-->
          <el-button
            size="mini"
            type="text"
            @click="handleOperationLog(scope.row)"
          >            <svg-icon class="svg" icon-class="details"/>
            操作日志
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <el-dialog title="预算明细" :visible.sync="openTabYsmx" width="1000px" append-to-body>
      <el-tabs type="border-card">
        <el-tab-pane label="明细信息">
          <div style="min-height: 450px;">
            <el-form :model="querybudgetFundsParams" ref="querybudgetFundsForm" :inline="true" v-show="showSearch">
              <el-form-item label="县区" prop="city" v-show="cityShow">
                <el-select
                  v-model="querybudgetFundsParams.city"
                  clearable
                  placeholder="请选择"
                  size="small"
                  @change="selectCity"
                >
                  <el-option
                    v-for="item in this.cityData"
                    :key="item.deptCode"
                    :label="item.deptName"
                    :value="item.deptCode">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="乡镇" prop="town" v-show="townShow">
                <el-select
                  v-model="querybudgetFundsParams.town"
                  clearable
                  placeholder="请选择"
                  size="small"
                  @change="selectTown"
                >
                  <el-option
                    v-for="item in this.townData"
                    :key="item.deptCode"
                    :label="item.deptName"
                    :value="item.deptCode">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="村" prop="village" v-show="villageShow">
                <el-select
                  v-model="querybudgetFundsParams.village"
                  clearable
                  placeholder="请选择"
                  size="small"
                  @change="selectVillage"
                >
                  <el-option
                    v-for="item in this.villageData"
                    :key="item.deptCode"
                    :label="item.deptName"
                    :value="item.deptCode">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="承包方" prop="cbfmc">
                <el-input
                  v-model="querybudgetFundsParams.cbfmc"
                  placeholder="请输入承包方"
                  clearable
                  size="small"
                />
              </el-form-item>
              <el-form-item>
                <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleDetailsQuery">搜索</el-button>
                <el-button icon="el-icon-refresh" size="mini" @click="resetDetailsQuery">重置</el-button>
              </el-form-item>
            </el-form>
            <el-table v-loading="loading" :data="detailsList" @selection-change="handleSelectionChange">
              <el-table-column width="220" label="行政区划" align="center" prop="county">
                <template slot-scope="scope">
                  {{ scope.row.county }} - {{ scope.row.township }} - {{ scope.row.village }}
                </template>
              </el-table-column>
              <!--<el-table-column label="县区" width="50" align="center" prop="county"/>
              <el-table-column label="乡镇" width="80" align="center" prop="township"/>
              <el-table-column label="村" width="100" align="center" prop="village"/>-->
              <el-table-column label="承包方" align="center" prop="cbfmc"/>
              <el-table-column label="地块编码" width="200" align="center" prop="dkbm"/>
              <el-table-column label="面积（亩）" width="90" align="center" prop="evaluationArea"/>
              <el-table-column label="补偿项名称" width="120" align="center" prop="itemName"/>
              <el-table-column label="评估价（元）" width="120" align="center" prop="price">
                <template slot-scope="scope">
                  {{
                    scope.row.price == 0 ? "-" : (String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                  }}
                </template>
              </el-table-column>
            </el-table>
          </div>
          <pagination
            v-show="detailstotal>0"
            :total="detailstotal"
            :page.sync="querybudgetFundsParams.pageNum"
            :limit.sync="querybudgetFundsParams.pageSize"
            @pagination="getDetailsList"
          />
        </el-tab-pane>
        <el-tab-pane label="汇总信息">
          <div style="min-height: 450px;">
            <el-table v-loading="loading" :data="pghzList" @selection-change="handleSelectionChange">
              <!--   <el-table-column label="县区" width="60" align="center" prop="xjname"/>
                 <el-table-column label="乡镇" width="80" align="center" prop="zjname"/>-->
              <el-table-column fixed label="机构名称" min-width="120" align="center" prop="deptName"/>
              <!-- <el-table-column label="国有土地" align="center">
                 <el-table-column
                   align="center"
                   prop="statis.gytdmj"
                   label="面积（亩）"
                   width="120">
                   <template slot-scope="scope">
                     <div>{{ scope.row.statis.gytdmj == 0 ? "-" : scope.row.statis.gytdmj }}
                     </div>
                   </template>
                 </el-table-column>
                 <el-table-column
                   align="center"
                   prop="statis.gytdprice"
                   label="金额（元）"
                   width="120">
                   <template slot-scope="scope">
                     <div>
                       {{
                         scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                       }}
                     </div>
                   </template>
                 </el-table-column>
               </el-table-column>
               <el-table-column label="集体土地" align="center">
                 <el-table-column
                   align="center"
                   prop="statis.jttdmj"
                   label="面积（亩）"
                   width="120">
                   <template slot-scope="scope">
                     <div>{{ scope.row.statis.jttdmj == 0 ? "-" : scope.row.statis.jttdmj }}
                     </div>
                   </template>
                 </el-table-column>
                 <el-table-column
                   align="center"
                   prop="statis.jttdprice"
                   label="金额（元）"
                   width="120">
                   <template slot-scope="scope">
                     <div> {{
                         scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                       }}
                     </div>
                   </template>
                 </el-table-column>
               </el-table-column>
               <el-table-column label="附着物" align="center">
                 <el-table-column
                   align="center"
                   prop="statis.qmmj"
                   label="面积（亩）"
                   width="120">
                   <template slot-scope="scope">
                     <div>{{ scope.row.statis.qmmj == 0 ? "-" : scope.row.statis.qmmj }}
                     </div>
                   </template>
                 </el-table-column>
                 <el-table-column
                   align="center"
                   prop="statis.qmprice"
                   label="金额（元）"
                   width="120">
                   <template slot-scope="scope">
                     <div style="line-height: 23px; text-align: left;" v-show="scope.row.statis.qmprice !=0">
                       {{
                         scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                       }}
                     </div>
                   </template>
                 </el-table-column>
               </el-table-column>
               <el-table-column label="地上附属物" align="center">
                 <el-table-column
                   align="center"
                   prop="statis.fswmj"
                   label="面积（亩）"
                   width="120">
                   <template slot-scope="scope">
                     <div>{{ scope.row.statis.fswmj == 0 ? "-" : scope.row.statis.fswmj }}
                     </div>
                   </template>
                 </el-table-column>
                 <el-table-column
                   align="center"
                   prop="statis.fswprice"
                   label="金额（元）"
                   width="120">
                   <template slot-scope="scope">
                     <div style="line-height: 23px; text-align: center;">
                       {{
                         scope.row.statis.fswprice == 0 || scope.row.statis.fswprice == "" ? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                       }}
                     </div>
                   </template>
                 </el-table-column>
               </el-table-column>-->
              <el-table-column label="地块数" min-width="80" align="center" prop="statis.dkzs"/>
              <el-table-column label="总面积" min-width="100" align="center" prop="zmj"/>
              <el-table-column label="预算金额（元）" min-width="120" align="center" prop="totalMoney">
                <template slot-scope="scope">
                  {{
                    scope.row.totalMoney == 0 ? "-" : (String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                  }}
                </template>
              </el-table-column>
              <el-table-column label="备注" min-width="270" align="center" prop="aa">
                <template slot-scope="scope">
                  <div align="left" v-if="scope.row.statis.gytdmj!=null&&scope.row.statis.gytdmj!=''"> {{
                      "国有土地 （面积：" + scope.row.statis.gytdmj + "金额：" +
                      (scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.gytdprice).split('.')[1].length < 2 ? String(scope.row.statis.gytdprice).split('.')[1] + "0" : String(scope.row.statis.gytdprice).split('.')[1]))) + "）"
                    }}
                  </div>
                  <div align="left" v-if="scope.row.statis.jttdmj!=null&&scope.row.statis.jttdmj!=''"> {{
                      '集体土地 （面积：' + scope.row.statis.jttdmj + " 金额：" +
                      (scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.jttdprice).split('.')[1].length < 2 ? String(scope.row.statis.jttdprice).split('.')[1] + '0' : String(scope.row.statis.jttdprice).split('.')[1]))) + "）"
                    }}
                  </div>
                  <div align="left" v-if="scope.row.statis.qmmj!=null&&scope.row.statis.qmmj!=''"> {{
                      '青 苗  （面积：' + scope.row.statis.qmmj + ' 金额：' +
                      (scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.qmprice).split('.')[1].length < 2 ? String(scope.row.statis.qmprice).split('.')[1] + '0' : String(scope.row.statis.qmprice).split('.')[1]))) + "）"
                    }}
                  </div>
                  <div align="left" v-if="scope.row.statis.fswmj!=null&&scope.row.statis.fswmj!=''"> {{
                      '地上附属物  （面积：' + scope.row.statis.fswmj + ' 金额：' +
                      (scope.row.statis.fswprice == 0 ? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.fswprice).split('.')[1].length < 2 ? String(scope.row.statis.fswprice).split('.')[1] + '0' : String(scope.row.statis.fswprice).split('.')[1]))) + "）"
                    }}
                  </div>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <pagination
            v-show="pghztotal>0"
            :total="pghztotal"
            :page.sync="querypghzParams.pageNum"
            :limit.sync="querypghzParams.pageSize"
            @pagination="getPghzList"
          />
        </el-tab-pane>
      </el-tabs>
    </el-dialog>

    <el-dialog title="预算明细" :visible.sync="openTabYsmxCun" width="1000px" append-to-body>
      <el-form :model="querybudgetFundsParams" ref="querybudgetFundsForm" :inline="true" v-show="showSearch">
        <el-form-item label="县区" prop="city" v-show="cityShow">
          <el-select
            v-model="querybudgetFundsParams.city"
            clearable
            placeholder="请选择"
            size="small"
            @change="selectCity"
          >
            <el-option
              v-for="item in this.cityData"
              :key="item.deptCode"
              :label="item.deptName"
              :value="item.deptCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="乡镇" prop="town" v-show="townShow">
          <el-select
            v-model="querybudgetFundsParams.town"
            clearable
            placeholder="请选择"
            size="small"
            @change="selectTown"
          >
            <el-option
              v-for="item in this.townData"
              :key="item.deptCode"
              :label="item.deptName"
              :value="item.deptCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="村" prop="village" v-show="villageShow">
          <el-select
            v-model="querybudgetFundsParams.village"
            clearable
            placeholder="请选择"
            size="small"
            @change="selectVillage"
          >
            <el-option
              v-for="item in this.villageData"
              :key="item.deptCode"
              :label="item.deptName"
              :value="item.deptCode">
            </el-option>
          </el-select>
        </el-form-item>


        <!--<el-form-item label="村" prop="departmentCode">
          <el-select
            v-model="querybudgetFundsParams.departmentCode"
            clearable
            placeholder="请选择村"
            style="width: 120px"
          >
            <el-option
              v-for="item in this.villageData"
              :key="item.deptCode"
              :label="item.deptName"
              :value="item.deptCode">
            </el-option>
          </el-select>
        </el-form-item>-->
        <el-form-item label="承包方" prop="cbfmc">
          <el-input
            v-model="querybudgetFundsParams.cbfmc"
            placeholder="请输入承包方"
            clearable
            size="small"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleDetailsQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetDetailsQuery">重置</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="loading" :data="detailsList" @selection-change="handleSelectionChange">
        <el-table-column width="220" label="行政区划" align="center" prop="county">
          <template slot-scope="scope">
            {{ scope.row.county }} - {{ scope.row.township }} - {{ scope.row.village }}
          </template>
        </el-table-column>
        <!--<el-table-column label="县区" width="50" align="center" prop="county"/>
        <el-table-column label="乡镇" width="80" align="center" prop="township"/>
        <el-table-column label="村" width="100" align="center" prop="village"/>-->
        <el-table-column label="承包方" align="center" prop="cbfmc"/>
        <el-table-column label="地块编码" width="200" align="center" prop="dkbm"/>
        <el-table-column label="面积（亩）" width="90" align="center" prop="evaluationArea"/>
        <el-table-column label="补偿项名称" width="120" align="center" prop="itemName"/>
        <el-table-column label="评估价（元）" width="120" align="center" prop="price">
          <template slot-scope="scope">
            {{
              scope.row.price == 0 ? "-" : (String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
            }}
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="detailstotal>0"
        :total="detailstotal"
        :page.sync="querybudgetFundsParams.pageNum"
        :limit.sync="querybudgetFundsParams.pageSize"
        @pagination="getDetailsList"
      />
    </el-dialog>

    <el-dialog title="审核记录" :visible.sync="openShjl" width="1000px" append-to-body>
      <div style="min-height: 484px">
        <el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
          <el-table-column label="审核人" align="center" prop="personalName"/>
          <el-table-column label="审核时间" align="center" prop="approvingTime"/>
          <el-table-column label="审核状态" align="center" prop="state">
            <template slot-scope="scope">
              <div class="statusDv">
                <div class="statudPoint" :class="'Bg'+scope.row['state']"></div>
                <div v-for="sta in budgetStatus" v-if="sta.dictValue == scope.row['state']">{{ sta.dictLabel }}</div>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="审核意见" align="center" prop="by1"/>
        </el-table>
      </div>
      <pagination
        v-show="recordtotal>0"
        :total="recordtotal"
        :page.sync="queryRecordParams.pageNum"
        :limit.sync="queryRecordParams.pageSize"
        @pagination="getRecordList"
      />
    </el-dialog>

    <el-dialog :title="'生成预算'" :visible.sync="openBudget" width="1000px" append-to-body @close="cancelMy">
      <el-steps :active="active" finish-status="success" align-center style="margin-bottom: 20px">
        <el-step title="填写信息"></el-step>
        <el-step title="明细信息"></el-step>
        <el-step title="汇总信息"></el-step>
      </el-steps>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px" v-if="active == 0">
        <el-form ref="myform" :model="myform" :rules="rules" label-width="120px">
          <el-form-item label="预算编号" prop="number">
            <el-input v-model="myform.number" placeholder="请输入预算编号" disabled/>
            <el-input v-model="myform.totalMoney" v-show="1==2" placeholder="请输入预算编号"/>
          </el-form-item>
          <el-form-item label="预算年度" prop="year">
            <el-date-picker
              style="width: 100%"
              v-model="myform.year"
              value-format="yyyy"
              type="year"
              disabled
              @change="selectYear"
              placeholder="选择预算年度">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="预算名称" prop="name">
            <el-input v-model="myform.name" placeholder="请输入预算名称"/>
          </el-form-item>
          <!--<el-form-item label="备注" prop="remarks">
            <el-input v-model="myform.remarks" type="textarea" placeholder="请输入内容"/>
          </el-form-item>-->
        </el-form>
      </el-form>
      <div v-else-if="active == 1">
        <el-form :model="querypgParams" ref="querypgForm" :inline="true" v-show="showSearch">
          <el-form-item label="县区" prop="city" v-show="cityShow">
            <el-select
              v-model="querypgParams.city"
              clearable
              placeholder="请选择"
              size="small"
              @change="selectCity"
            >
              <el-option
                v-for="item in this.cityData"
                :key="item.deptCode"
                :label="item.deptName"
                :value="item.deptCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="乡镇" prop="town" v-show="townShow">
            <el-select
              v-model="querypgParams.town"
              clearable
              placeholder="请选择"
              size="small"
              @change="selectTown"
            >
              <el-option
                v-for="item in this.townData"
                :key="item.deptCode"
                :label="item.deptName"
                :value="item.deptCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="村" prop="village" v-show="villageShow">
            <el-select
              v-model="querypgParams.village"
              clearable
              placeholder="请选择"
              size="small"
              @change="selectVillage"
            >
              <el-option
                v-for="item in this.villageData"
                :key="item.deptCode"
                :label="item.deptName"
                :value="item.deptCode">
              </el-option>
            </el-select>
          </el-form-item>
          <!-- <el-form-item label="村" prop="departmentCode">
             <el-select
               v-model="querypgParams.departmentCode"
               clearable
               placeholder="请选择村"
               style="width: 120px"
             >
               <el-option
                 v-for="item in this.villageData"
                 :key="item.deptCode"
                 :label="item.deptName"
                 :value="item.deptCode">
               </el-option>
             </el-select>
           </el-form-item>-->
          <el-form-item label="承包方" prop="cbfmc">
            <el-input
              v-model="querypgParams.cbfmc"
              placeholder="请输入承包方"
              clearable
              size="small"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleScpgQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetPgQuery">重置</el-button>
          </el-form-item>
        </el-form>
        <el-table v-loading="loading" :data="pgList" @selection-change="handleSelectionChange" width="100%">
          <el-table-column width="220" label="行政区划" align="center" prop="county">
            <template slot-scope="scope">
              {{ scope.row.county }} - {{ scope.row.township }} - {{ scope.row.village }}
            </template>
          </el-table-column>
          <!--<el-table-column label="县区" width="60" align="center" prop="county"/>
          <el-table-column label="乡镇" width="80" align="center" prop="township"/>
          <el-table-column label="村" width="90" align="center" prop="village"/>-->
          <el-table-column label="承包方" align="center" prop="cbfmc"/>
          <el-table-column label="地块编码" width="180" align="center" prop="dkbm"/>
          <el-table-column label="评估项" width="120" align="center" prop="itemName"/>
          <el-table-column label="面积（亩）" width="90" align="center" prop="evaluationArea"/>
          <el-table-column label="评估价（元）" width="120" align="center" prop="price">
            <template slot-scope="scope">
              {{
                scope.row.price == 0 ? "-" : (String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
              }}
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="pgtotal>0"
          :total="pgtotal"
          :page.sync="querypgParams.pageNum"
          :limit.sync="querypgParams.pageSize"
          @pagination="getScpgList"
        />
      </div>
      <div v-else-if="active == 2">
        <div style="min-height: 400px;">
          <el-table v-loading="loading" :data="pghzList" @selection-change="handleSelectionChange">
            <el-table-column fixed label="机构名称" min-width="130" align="center" prop="deptName"/>
            <!-- <el-table-column label="国有土地" align="center">
               <el-table-column
                 align="center"
                 prop="statis.gytdmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   {{ scope.row.statis.gytdmj == 0 ? "-" : scope.row.statis.gytdmj }}
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.gytdprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div>
                     {{
                       scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>
             <el-table-column label="集体土地" align="center">
               <el-table-column
                 align="center"
                 prop="statis.jttdmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   <div>{{ scope.row.statis.jttdmj == 0 ? "-" : scope.row.statis.jttdmj }}
                   </div>
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.jttdprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div> {{
                       scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>
             <el-table-column label="附着物" align="center">
               <el-table-column
                 align="center"
                 prop="statis.qmmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   <div>{{ scope.row.statis.qmmj == 0 ? "-" : scope.row.statis.qmmj }}
                   </div>
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.qmprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div style="line-height: 23px; text-align: left;" v-show="scope.row.statis.qmprice !=0">
                     {{
                       scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>
             <el-table-column label="地上附属物" align="center">
               <el-table-column
                 align="center"
                 prop="statis.fswmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   <div>{{ scope.row.statis.fswmj == 0 ? "-" : scope.row.statis.fswmj }}
                   </div>
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.fswprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div style="line-height: 23px; text-align: center;">
                     {{
                       scope.row.statis.fswprice == 0 || scope.row.statis.fswprice == "" ? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>-->
            <el-table-column label="地块数" min-width="100" align="center" prop="statis.dkzs"/>
            <el-table-column label="总面积（亩）" min-width="100" align="center" prop="zmj">
              <template slot-scope="scope">
                {{ (parseInt(scope.row.statis.gytdmj * 10000) + parseInt(scope.row.statis.jttdmj * 10000)) / 10000 }}
              </template>
            </el-table-column>
            <el-table-column label="预算金额（元）" min-width="130" align="center" prop="totalMoney">
              <template slot-scope="scope">
          <span>{{
              scope.row.totalMoney == 0 ? "-" : (String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
            }}</span>
              </template>
            </el-table-column>
            <el-table-column label="备注" min-width="270" align="center" prop="aa">
              <template slot-scope="scope">
                <div align="left" v-if="scope.row.statis.gytdmj!=null&&scope.row.statis.gytdmj!=''"> {{
                    "国有土地 （面积：" + scope.row.statis.gytdmj + "金额：" +
                    (scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.gytdprice).split('.')[1].length < 2 ? String(scope.row.statis.gytdprice).split('.')[1] + "0" : String(scope.row.statis.gytdprice).split('.')[1]))) + "）"
                  }}
                </div>
                <div align="left" v-if="scope.row.statis.jttdmj!=null&&scope.row.statis.jttdmj!=''"> {{
                    '集体土地 （面积：' + scope.row.statis.jttdmj + " 金额：" +
                    (scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.jttdprice).split('.')[1].length < 2 ? String(scope.row.statis.jttdprice).split('.')[1] + '0' : String(scope.row.statis.jttdprice).split('.')[1]))) + "）"
                  }}
                </div>
                <div align="left" v-if="scope.row.statis.qmmj!=null&&scope.row.statis.qmmj!=''"> {{
                    '青 苗  （面积：' + scope.row.statis.qmmj + ' 金额：' +
                    (scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.qmprice).split('.')[1].length < 2 ? String(scope.row.statis.qmprice).split('.')[1] + '0' : String(scope.row.statis.qmprice).split('.')[1]))) + "）"
                  }}
                </div>
                <div align="left" v-if="scope.row.statis.fswmj!=null&&scope.row.statis.fswmj!=''"> {{
                    '地上附属物  （面积：' + scope.row.statis.fswmj + ' 金额：' +
                    (scope.row.statis.fswprice == 0 ? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.fswprice).split('.')[1].length < 2 ? String(scope.row.statis.fswprice).split('.')[1] + '0' : String(scope.row.statis.fswprice).split('.')[1]))) + "）"
                  }}
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!--<pagination
             v-show="pghztotal>0"
             :total="pghztotal"
             :page.sync="querypghzParams.pageNum"
             :limit.sync="querypghzParams.pageSize"
             @pagination="getAddPghzList"
           />-->
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancelMy">取 消</el-button>
        <el-button type="primary" plain @click="presAdd" v-if="active == 1||active == 2">上一步</el-button>
        <el-button type="success" plain @click="nextAdd" v-if="active == 0||active == 1">下一步</el-button>
        <el-button type="success" plain @click="submitBudgetFundsForm" v-if="active == 2">完成</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="'审核'" :visible.sync="openCheck" width="1000px" append-to-body @close="cancel">
      <el-steps :active="activeCheck" finish-status="success" align-center style="margin-bottom: 20px">
        <el-step title="明细信息"></el-step>
        <el-step title="汇总信息"></el-step>
        <el-step title="审核意见"></el-step>
      </el-steps>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px" v-if="activeCheck == 0">
        <el-form :model="queryShParams" ref="queryShParams" :inline="true" v-show="showSearch">
          <el-form-item label="县区" prop="city" v-show="cityShow">
            <el-select
              v-model="queryShParams.city"
              clearable
              placeholder="请选择"
              size="small"
              @change="selectCity"
            >
              <el-option
                v-for="item in this.cityData"
                :key="item.deptCode"
                :label="item.deptName"
                :value="item.deptCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="乡镇" prop="town" v-show="townShow">
            <el-select
              v-model="queryShParams.town"
              clearable
              placeholder="请选择"
              size="small"
              @change="selectTown"
            >
              <el-option
                v-for="item in this.townData"
                :key="item.deptCode"
                :label="item.deptName"
                :value="item.deptCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="村" prop="village" v-show="villageShow">
            <el-select
              v-model="queryShParams.village"
              clearable
              placeholder="请选择"
              size="small"
              @change="selectVillage"
            >
              <el-option
                v-for="item in this.villageData"
                :key="item.deptCode"
                :label="item.deptName"
                :value="item.deptCode">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="承包方" prop="cbfmc">
            <el-input
              v-model="queryShParams.cbfmc"
              placeholder="请输入承包方"
              clearable
              size="small"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleShQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetShQuery">重置</el-button>
          </el-form-item>
        </el-form>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              icon="el-icon-download"
              size="mini"
              type="warning"
              :disabled="multiple"
              @click="handleDetailsExport"
            >导出
            </el-button>
          </el-col>
        </el-row>
        <el-table v-loading="loading" :data="shList">
          <el-table-column width="220" label="行政区划" align="center" prop="county">
            <template slot-scope="scope">
              {{ scope.row.county }} - {{ scope.row.township }} - {{ scope.row.village }}
            </template>
          </el-table-column>
          <!--<el-table-column label="县区" align="center" prop="county"/>
          <el-table-column label="乡镇" align="center" prop="township"/>
          <el-table-column label="村" align="center" prop="village"/>-->
          <el-table-column label="承包方" align="center" prop="cbfmc"/>
          <el-table-column label="地块编码" width="180" align="center" prop="dkbm"/>
          <el-table-column label="附着物" align="center" prop="itemName"/>
          <el-table-column label="面积（亩）" align="center" prop="evaluationArea"/>
          <el-table-column label="评估价（元）" align="center" prop="price">
            <template slot-scope="scope">
              {{
                scope.row.price == 0 ? "-" : (String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.price).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.price).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.price).split('.')[1].length < 2 ? String(scope.row.price).split('.')[1] + '0' : String(scope.row.price).split('.')[1]))
              }}
            </template>
          </el-table-column>
          <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
                 v-hasPermi="['system:CBF:edit']"
               >查看地块
               </el-button>

             </template>
           </el-table-column>-->
        </el-table>
        <pagination
          v-show="shtotal>0"
          :total="shtotal"
          :page.sync="queryShParams.pageNum"
          :limit.sync="queryShParams.pageSize"
          @pagination="getApprovalList"
        />
      </el-form>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px" v-if="activeCheck == 1">
        <div style="min-height: 400px;">
          <el-table v-loading="loading" :data="pghzList" @selection-change="handleSelectionChange">
            <!--<el-table-column fixed label="县区" width="60" align="center" prop="xjname"/>
            <el-table-column fixed label="乡镇" width="80" align="center" prop="zjname"/>
            <el-table-column fixed label="村" width="120" align="center" prop="cjname"/>-->
            <el-table-column fixed label="机构名称" min-width="120" align="center" prop="deptName"/>
            <!-- <el-table-column label="国有土地" align="center">
               <el-table-column
                 align="center"
                 prop="statis.gytdmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   <div>{{ scope.row.statis.gytdmj == 0 ? "-" : scope.row.statis.gytdmj }}
                   </div>
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.gytdprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div>
                     {{
                       scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>
             <el-table-column label="集体土地" align="center">
               <el-table-column
                 align="center"
                 prop="statis.jttdmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   <div>{{ scope.row.statis.jttdmj == 0 ? "-" : scope.row.statis.jttdmj }}
                   </div>
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.jttdprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div> {{
                       scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>
             <el-table-column label="附着物" align="center">
               <el-table-column
                 align="center"
                 prop="statis.qmmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   <div>{{ scope.row.statis.qmmj == 0 ? "-" : scope.row.statis.qmmj }}
                   </div>
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.qmprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div style="line-height: 23px; text-align: left;" v-show="scope.row.statis.qmprice !=0">
                     {{
                       scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>
             <el-table-column label="地上附属物" align="center">
               <el-table-column
                 align="center"
                 prop="statis.fswmj"
                 label="面积（亩）"
                 width="120">
                 <template slot-scope="scope">
                   <div>{{ scope.row.statis.fswmj == 0 ? "-" : scope.row.statis.fswmj }}
                   </div>
                 </template>
               </el-table-column>
               <el-table-column
                 align="center"
                 prop="statis.fswprice"
                 label="金额（元）"
                 width="120">
                 <template slot-scope="scope">
                   <div style="line-height: 23px; text-align: center;">
                     {{
                       scope.row.statis.fswprice == 0 ||scope.row.statis.fswprice == ""? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
                     }}
                   </div>
                 </template>
               </el-table-column>
             </el-table-column>-->
            <el-table-column label="总面积（亩）" min-width="100" align="center" prop="zmj">
              <template slot-scope="scope">
                {{ (parseInt(scope.row.statis.gytdmj * 10000) + parseInt(scope.row.statis.jttdmj * 10000)) / 10000 }}
              </template>
            </el-table-column>
            <el-table-column label="地块数" min-width="80" align="center" prop="statis.dkzs"/>
            <el-table-column label="评估金额（元）" min-width="120" align="center" prop="totalMoney">
              <template slot-scope="scope">
                {{
                  scope.row.totalMoney == 0 ? "-" : (String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.totalMoney).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.totalMoney).split('.')[1].length < 2 ? String(scope.row.totalMoney).split('.')[1] + '0' : String(scope.row.totalMoney).split('.')[1]))
                }}
              </template>
            </el-table-column>
            <el-table-column label="备注" min-width="270" align="center" prop="aa">
              <template slot-scope="scope">
                <div align="center">
                  <div align="left" v-if="scope.row.statis.gytdmj!=null&&scope.row.statis.gytdmj!=''"> {{
                      "国有土地 （面积：" + scope.row.statis.gytdmj + "金额：" +
                      (scope.row.statis.gytdprice == 0 ? "-" : (String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.gytdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.gytdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.gytdprice).split('.')[1].length < 2 ? String(scope.row.statis.gytdprice).split('.')[1] + "0" : String(scope.row.statis.gytdprice).split('.')[1]))) + "）"
                    }}
                  </div>
                  <div align="left" v-if="scope.row.statis.jttdmj!=null&&scope.row.statis.jttdmj!=''"> {{
                      '集体土地 （面积：' + scope.row.statis.jttdmj + " 金额：" +
                      (scope.row.statis.jttdprice == 0 ? "-" : (String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.jttdprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.jttdprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.jttdprice).split('.')[1].length < 2 ? String(scope.row.statis.jttdprice).split('.')[1] + '0' : String(scope.row.statis.jttdprice).split('.')[1]))) + "）"
                    }}
                  </div>
                  <div align="left" v-if="scope.row.statis.qmmj!=null&&scope.row.statis.qmmj!=''"> {{
                      '青 苗  （面积：' + scope.row.statis.qmmj + ' 金额：' +
                      (scope.row.statis.qmprice == 0 ? "-" : (String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.qmprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.qmprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.qmprice).split('.')[1].length < 2 ? String(scope.row.statis.qmprice).split('.')[1] + '0' : String(scope.row.statis.qmprice).split('.')[1]))) + "）"
                    }}
                  </div>
                  <div align="left" v-if="scope.row.statis.fswmj!=null&&scope.row.statis.fswmj!=''"> {{
                      '地上附属物  （面积：' + scope.row.statis.fswmj + ' 金额：' +
                      (scope.row.statis.fswprice == 0 ? "-" : (String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.statis.fswprice).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.statis.fswprice).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(scope.row.statis.fswprice).split('.')[1].length < 2 ? String(scope.row.statis.fswprice).split('.')[1] + '0' : String(scope.row.statis.fswprice).split('.')[1]))) + "）"
                    }}
                  </div>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <pagination
          v-show="pghztotal>0"
          :total="pghztotal"
          :page.sync="querypghzParams.pageNum"
          :limit.sync="querypghzParams.pageSize"
          @pagination="getPghzList"
        />
      </el-form>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px" v-else-if="activeCheck == 2">
        <!--<el-form-item label="已签合同金额">
          {{ this.yqhtje == 0 ? "-" : String(parseInt(this.yqhtje)).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') }}
        </el-form-item>
        <el-form-item label="新合同金额">
          {{ this.xhtje == 0 ? "-" : String(parseInt(this.xhtje)).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') }}
        </el-form-item>-->
        <el-form-item label="预算总金额">
          {{
            this.yszje == 0 ? "-" : (String(this.yszje).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(this.yszje).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(this.yszje).split('.')[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + "." + (String(this.yszje).split('.')[1].length < 2 ? String(this.yszje).split('.')[1] + '0' : String(this.yszje).split('.')[1])) + " 元"
          }}
        </el-form-item>
        <el-form-item label="审核状态" prop="state">
          <!-- <el-select
             style="width: 100%"
             v-model="form.state"
             collapse-tags
             placeholder="请选择">
             <el-option
               v-for="dict in approveStatus"
               :key="dict.dictValue"
               :label="dict.dictLabel"
               :value="dict.dictValue">
             </el-option>
           </el-select>-->

          <el-radio-group v-model="form.state">
            <el-radio v-for="item in approveStatus"
                      border
                      size="medium"
                      :label="item.dictValue">
              {{ item.dictLabel }}
            </el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见" prop="by1">
          <el-input v-model="form.by1" type="textarea" placeholder="请输入审核意见"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancelCheck">取 消</el-button>
        <el-button type="primary" @click="presCheck" v-if="activeCheck == 1||activeCheck == 2">上一步</el-button>
        <el-button type="primary" @click="nextspCheck" v-if="activeCheck == 0||activeCheck == 1">下一步</el-button>
        <el-button type="success" @click="submitFormsp" v-if="activeCheck == 2">完成</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="'驳回'" :visible.sync="openCheckReject" width="1000px" append-to-body @close="cancelCheck">
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="驳回意见" prop="by1">
          <el-input v-model="form.by1" type="textarea" placeholder="请输入驳回意见"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancelCheck">取 消</el-button>
        <el-button type="success" @click="submitFormReject">完成</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="'我的预算'" :visible.sync="openMyBudget" width="1000px" append-to-body>
      <div style="min-height: 484px">
        <el-table v-loading="loading" :data="MyBudgetFundsList" @selection-change="handleSelectionChange">
          <el-table-column label="预算编号" width="200" align="center" prop="number"/>
          <el-table-column label="预算名称" align="center" prop="name"/>
          <el-table-column label="预算年份" align="center" prop="year"/>
          <el-table-column label="面积（亩）" align="center" prop="zmj"/>
          <el-table-column label="预算金额（元）" width="135" align="center" prop="totalMoney">
            <template slot-scope="scope">
              {{
                scope.row.totalMoney == 0 ? "-" : (String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,').split('.').length < 2 ? String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + ".00" : String(scope.row.totalMoney).replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'))
              }}
            </template>
          </el-table-column>
          <el-table-column label="预算单位" align="center" prop="deptName"/>
          <el-table-column label="审核状态" align="center" prop="state" :formatter="contractFormat"/>
          <!--      <el-table-column label="审核时间" align="center" prop="approvalTime"/>-->
          <!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleDetails(scope.row)"
              >预算明细
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
              >审核记录
              </el-button>
            </template>
          </el-table-column>-->
        </el-table>
      </div>
      <pagination
        v-show="mytotal>0"
        :total="mytotal"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getMyList"
      />
    </el-dialog>

    <el-dialog title="操作日志" :visible.sync="openCzrz" width="1000px" append-to-body @close="cancel">
      <div style="min-height: 484px">
        <el-table v-loading="loading" :data="htczrzList">
          <el-table-column label="操作名称" align="center" prop="operName"/>
          <el-table-column label="操作人" align="center" prop="by1"/>
          <el-table-column label="操作时间" align="center" prop="createTime"/>
        </el-table>
      </div>
      <pagination
        v-show="htczrztotal>0"
        :total="htczrztotal"
        :page.sync="queryczrzParams.pageNum"
        :limit.sync="queryczrzParams.pageSize"
        @pagination="getCzrzList"
      />
    </el-dialog>
  </div>
</template>

<script>
import {
  addBudgetFunds,
  approval,
  approvalList,
  approvalMoney,
  childList,
  childListByMutiParentIds,
  countyAdd,
  countyMoney,
  delBudgetFunds,
  deptList, exportList,
  exportMxList,
  getBudgetFunds,
  getNumber,
  listBudgetFunds,
  listMyBudgetFunds,
  mxList,
  mxListByBudgetIds, operationLog,
  statis,
  statisForAddOrUpdate,
  subList,
  updateBudgetFunds,
  verifyForAddOrUpdateTownship,
  VillageMxList
} from "@/api/zjgl/budgetFunds";
import {childlistUse, getDept} from "@/api/system/dept";
import {getInfo} from "@/api/login";

export default {
  name: "BudgetFunds",
  data() {
    return {
      openMyBudget: false,
      openCheck: false,
      openCheckReject: false,
      openBudget: false,
      openYsmx: false,
      opencbfYsmx: false,
      opencbfYsmxXian: false,
      opencbfYsmxQu: false,
      openShjl: false,
      deptCode: '',
      budgetId: '',
      cityShow: '',
      townShow: '',
      villageShow: '',
      isReject: true,
      pgList: [],
      pghzList: [],
      villageData: [],
      villageXianData: [],
      cityXianData: [],
      townXianData: [],
      detailsList: [],
      detailsListXian: [],
      statusOptions: [],
      budgetStatus: [],
      approveStatus: [],
      villageSelectData: [],//选择村的数据
      openCzrz: false,
      htczrzList: [],
      htczrztotal: 0,
      activeCheck: 0,
      active: 0,
      // 遮罩层
      loading: false,
      newloading: false,
      loadingYsmx: false,
      // 选中数组
      ids: [],
      budgetIds: '',
      shList: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      pgtotal: 0,
      pghztotal: 0,
      shtotal: 0,
      mytotal: 0,
      detailstotal: 0,//预算明细
      detailstotalXian: 0,//预算明细
      detailstotalQu: 0,//预算明细
      detailsListQu: [],
      // 【请填写功能名称】表格数据
      recordList: [],
      recordtotal: 0,
      MyBudgetFundsList: [],
      cityData: [],
      townData: [],
      BudgetFundsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      openTabYsmx: false,
      openTabYsmxCun: false,
      // 查询参数
      querypgParams: {
        pageNum: 1,
        pageSize: 10,
        cbfmc: null,
        village: null,
        town: null,
        city: null,
        departmentCode: null,
      },
      queryczrzParams: {
        pageNum: 1,
        pageSize: 10,
        budgetIds: null,
      },
      querypghzParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        departmentCode: null,
        parentBudgetId: null,
      },
      queryShParams: {
        pageNum: 1,
        pageSize: 10,
        cbfmc: null,
        departmentCode: null,
        city: null,
        town: null,
        village: null,
      },
      querybudgetFundsParams: {
        pageNum: 1,
        pageSize: 10,
        budgetId: null,
        departmentCode: null,
        cbfmc: null,
        city: null,
        town: null,
        village: null,
      },
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        budgetId: null,
        name: null,
        year: null,
        states: null,
        sdate: null,
        edate: null,
        budgetpersonid: null,
        budgetperson: null,
        budgetmoney: null,
        submittime: null,
        number: null,
        remarks: null,
        state: null,
        approvedperson: null,
        approveddate: null,
        createtime: null,
        by1: null,
        by2: null,
        by3: null
      },
      queryRecordParams: {
        pageNum: 1,
        pageSize: 10,
      },
      yqhtje: 0,
      xhtje: 0,
      yszje: 0,
      value1: [],
      value2: [],
      // 表单参数
      form: {},
      myform: {},
      // 表单校验
      rules: {
        year: [
          {required: true, message: "预算年度不能为空", trigger: "blur"}
        ],
        departmentCode: [
          {required: true, message: "预算单位不能为空", trigger: "blur"}
        ],
        name: [
          {required: true, message: "预算名称不能为空", trigger: "blur"}
        ],
        number: [
          {required: true, message: "预算编号不能为空", trigger: "blur"}
        ],
      }
    };
  },
  created() {
    this.getDicts('sys_normal_disable').then(response => {
      this.statusOptions = response.data
    })
    this.getDicts('sys_budget_status').then(response => {
      this.budgetStatus = response.data
    })
    this.getDicts('sys_approve_status').then(response => {
      this.approveStatus = response.data
    })
    // this.queryParams.year = String(new Date().getFullYear());

    this.getList();

    getInfo().then(response => {
      let deptCode = response.user.dept.deptCode;
      if (deptCode.length >= 9) {
        this.isReject = false;
      }
    });
  },
  methods: {
    getCzrzList() {
      this.loading = true;
      this.queryczrzParams.contractIds=this.ids;
      operationLog(this.queryczrzParams).then(response=> {
        this.loading = false;
        this.htczrzList=response.rows;
        this.htczrztotal=response.total;
      });
    },
    handleOperationLog(row) {
      const ids = row.budgetId || this.ids;
      this.ids=row.budgetId;
      this.queryczrzParams.budgetIds=ids;
      this.openCzrz=true;
      operationLog(this.queryczrzParams).then(response=> {
        this.htczrzList=response.rows;
        this.htczrztotal=response.total;
      });
    },
    selectYear(val) {
      if (val) {
        let name = this.myform.name.split('年').length < 2 ? this.myform.name : this.myform.name.split('年')[1];
        this.myform.name = val + "年" + name;
      } else {
        this.myform.name = this.myform.name.split('年')[1];
      }
    },
    handleTabDetails(row) {
      let deptCode = row.departmentCode;
      if (deptCode.length == 4) {//新区
        this.cityShow = true;
        this.townShow = true;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.cityData = response.data;
        });
      } else if (deptCode.length == 6) {//县
        this.cityShow = false;
        this.townShow = true;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.townData = response.data;
        });
      } else if (deptCode.length == 9) {//镇
        this.cityShow = false;
        this.townShow = false;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.villageData = response.data;
        });
      } else if (deptCode.length == 12) {//村

        this.cityShow = false;
        this.townShow = false;
        this.villageShow = false;
      } else {
        this.childlist(1306);
        this.cityShow = true;
        this.townShow = true;
        this.villageShow = true;
      }
      this.openTabYsmx = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      this.querypghzParams.parentBudgetId = row.budgetId;
      //获取明细信息
      this.getDetailsList();
      this.getPghzList();
    },
    handleTabCunDetails(row) {
      let deptCode = row.departmentCode;
      if (deptCode.length == 4) {//新区
        this.cityShow = true;
        this.townShow = true;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.cityData = response.data;
        });
      } else if (deptCode.length == 6) {//县
        this.cityShow = false;
        this.townShow = true;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.townData = response.data;
        });
      } else if (deptCode.length == 9) {//镇
        this.cityShow = false;
        this.townShow = false;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.villageData = response.data;
        });
      } else if (deptCode.length == 12) {//村

        this.cityShow = false;
        this.townShow = false;
        this.villageShow = false;
      } else {
        this.childlist(1306);
        this.cityShow = true;
        this.townShow = true;
        this.villageShow = true;
      }
      this.openTabYsmxCun = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      this.querypghzParams.parentBudgetId = row.budgetId;
      //获取明细信息
      this.getDetailsList();
    },
    // 选择县
    selectCity(val) {
      this.deptCode = val;
      this.city = val;
      this.querypgParams.departmentCode = val;
      if (val != "" && val != null) {
        childlistUse(val).then(response => {
          this.townData = response.data;
        });
      }
    },
    // 选择镇
    selectTown(val) {
      this.deptCode = val;
      this.town = val;
      this.querypgParams.departmentCode = val;
      if (val != "" && val != null) {
        childlistUse(val).then(response => {
          this.villageData = response.data;
        });
      }
    },
    // 选择村
    selectVillage(val) {
      this.deptCode = val;
      this.village = val;
      this.querypgParams.departmentCode = val;
    },
    selectCityXian(val) {
      this.querybudgetFundsParams.departmentCode = val;
      childlistUse(val).then(response => {
        this.townXianData = response.data;
      });
    },
    // 选择镇
    selectTownXian(val) {
      this.querybudgetFundsParams.departmentCode = val;
      childlistUse(val).then(response => {
        this.villageXianData = response.data;
      });
    },
    // 选择村
    selectVillageXian(val) {
      this.querybudgetFundsParams.departmentCode = val;
      this.village = val;
    },
    checkboxT(row, rowIndex) {
      if (row.parentId != "" && row.parentId != undefined) {
        return false;//禁用
      } else {
        return true;//不禁用
      }
    },
    selectDept(val) {
      this.villageSelectData = [];
      this.villageSelectData = val;
      this.form.departmentCode = val.toString();
    },
    // 菜单状态字典翻译
    contractFormat(row, column) {
      return this.selectDictLabel(this.budgetStatus, row.state);
    },
    /** 查询【请填写功能名称】列表 */
    getList() {
      this.loading = true;
      let state = ["1", "2"];
      this.queryParams.states = state.toString();
      listBudgetFunds(this.queryParams).then(response => {
        this.BudgetFundsList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getPgList() {
      this.querypgParams.regionCodes = this.villageSelectData;
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      subList({
        regionCodes: this.villageSelectData,
        year: this.form.year,
        cbfmc: this.querypgParams.cbfmc,
        departmentCode: this.querypgParams.departmentCode
      }, this.querypgParams.pageNum, this.querypgParams.pageSize).then(response => {
        this.pgList = response.rows;
        this.pgtotal = response.total;
        this.loading = false;
      });
    },
    getScpgList() {
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);

      mxListByBudgetIds({
        budgetIds: budgetIds.toString(),
        pageNum: this.querypgParams.pageNum,
        pageSize: this.querypgParams.pageSize,
        cbfmc: this.querypgParams.cbfmc,
        departmentCode: this.querypgParams.departmentCode,
      }).then(response => {
        this.pgList = response.rows;
        this.pgtotal = response.total;
        this.loading = false;
      });
    },
    getAddPghzList() {
      statisForAddOrUpdate(
        this.villageSelectData,
        this.form.year,
        this.querypghzParams.pageNum,
        this.querypghzParams.pageSize
      ).then(response => {
        this.pghzList = response.rows;
        this.pghztotal = response.total;
        this.loading = false;
      });
    },
    getPghzList() {
      childList(
        this.querypghzParams.parentBudgetId,
        this.querypghzParams.pageNum,
        this.querypghzParams.pageSize
      ).then(response => {
        this.pghzList = response.rows;
        this.pghztotal = response.total;
        this.loading = false;
      });
    },
    getPghzLists() {
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      childListByMutiParentIds(
        budgetIds
      ).then(response => {
        this.pghzList = response.rows;
        this.pghztotal = response.total;
        this.loading = false;
      });
    },
    // 预算明细-县区
    getDetailsList() {
      this.loadingYsmx = true;
      mxList(this.querybudgetFundsParams).then(response => {
        this.detailsList = response.rows;
        this.detailstotal = response.total;
        this.loadingYsmx = false;
      });
    },
    getDetailsListXian() {
      this.loadingYsmx = true;
      mxList(this.querybudgetFundsParams).then(response => {
        this.detailsListXian = response.rows;
        this.detailstotalXian = response.total;
        this.loadingYsmx = false;
      });
    },
    // 预算明细-镇直接查看承包方
    getVillageMxList() {
      this.loadingYsmx = true;
      VillageMxList(this.querybudgetFundsParams).then(response => {
        this.detailsListQu = response.rows;
        this.detailstotalQu = response.total;
        this.loadingYsmx = false;
      });
    },
    // 我的预算
    getMyList() {
      this.loadingYsmx = true;
      this.querybudgetFundsParams.budgetId = "";
      listMyBudgetFunds(this.querybudgetFundsParams).then(response => {
        this.MyBudgetFundsList = response.rows;
        this.mytotal = response.total;
        this.loadingYsmx = false;
      });
    },
    pres() {
      let active = this.active - 1;
      if (active == 0) {
        this.active = 0;
      } else if (active == 1) {
        this.active = 1;
        subList({
          regionCodes: this.villageSelectData,
          year: this.form.year
        }, this.querypgParams.pageNum, this.querypgParams.pageSize).then(response => {
          this.pgList = response.rows;
          this.pgtotal = response.total;
          this.loading = false;
        });
      } else if (active == 2) {
        this.active = 2;
      } else {
        this.active = 0;
      }
    },
    next() {
      let active = this.active + 1;
      if (active == 1) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (active == 1) {
              this.active = 1;
            } else if (active == 2) {
              this.active = 2;
            } else if (active == 3) {
              this.active = 3;
            } else {
              this.active = 0;
            }
            //验证
            verifyForAddOrUpdateTownship({regionCodes: this.villageSelectData, year: this.form.year}).then(response => {
              if (response.code != 200) {
                this.msgError(response.msg);
                return false;
              }
              // if (this.active++ > 2) this.active = 0;
              subList({
                regionCodes: this.villageSelectData,
                year: this.form.year
              }, this.querypgParams.pageNum, this.querypgParams.pageSize).then(response => {
                this.pgList = response.rows;
                this.pgtotal = response.total;
                this.loading = false;
              });
              this.getAddPghzList();
            });
          }
        });
      } else {
        if (active == 1) {
          this.active = 1;
        } else if (active == 2) {
          this.active = 2;
        } else if (active == 3) {
          this.active = 3;
        } else {
          this.active = 0;
        }
      }
    },
    presAdd() {
      this.pghzList = [];
      let active = this.active - 1;
      if (active == 0) {
        this.active = 0;
      } else if (active == 1) {
        this.active = 1;
      } else if (active == 2) {
        this.active = 2;
      } else {
        this.active = 0;
      }
    },
    nextAdd() {
      let active = this.active + 1;
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      if (active == 1) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (active == 1) {
              this.active = 1;
              this.pghzList = [];
              mxListByBudgetIds({
                budgetIds: budgetIds.toString(),
                pageNum: this.queryShParams.pageNum,
                pageSize: this.queryShParams.pageSize
              }).then(response => {
                this.pgList = response.rows;
                this.pgtotal = response.total;
                this.loading = false;
              });

              /*statis(this.ids).then(response => {
                this.pghzList = response.rows;
                this.pghztotal = response.total;
                this.loading = false;
                if (response.code == 200) {
                  return false;
                }
              });*/
            } else if (active == 2) {
              this.active = 2;
              this.BudgetFundsList.forEach(item => {
                if (this.budgetIds.indexOf(item.budgetId) > -1) {
                  this.pghzList.push(item);
                }
              });
            } else if (active == 3) {
              this.active = 3;
            } else {
              this.active = 0;
            }
          }
        });
      } else {
        if (active == 1) {
          this.active = 1;
          let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
          mxListByBudgetIds({
            budgetIds: budgetIds.toString(),
            pageNum: this.queryShParams.pageNum,
            pageSize: this.queryShParams.pageSize
          }).then(response => {
            this.pgList = response.rows;
            this.pgtotal = response.total;
            this.loading = false;
          });
          statis(budgetIds).then(response => {
            /* this.pghzList = response.rows;
             this.pghztotal = response.total;*/
            this.loading = false;
            if (response.code == 200) {
              return false;
            }
          });
        } else if (active == 2) {
          this.active = 2;
          this.BudgetFundsList.forEach(item => {
            if (this.budgetIds.indexOf(item.budgetId) > -1) {
              this.pghzList.push(item);
            }
          });
        } else if (active == 3) {
          this.active = 3;
        } else {
          this.active = 0;
        }
      }
    },
    presCheck() {
      let activeCheck = this.activeCheck - 1;
      if (activeCheck == 0) {
        this.activeCheck = 0;
        //获取明细信息
        this.getApprovalList();
      }
      if (activeCheck == 1) {
        this.activeCheck = 1;
        approvalMoney({budgetIds: budgetIds}).then(response => {
          this.xhtje = response.data.xzhtje;
          this.yqhtje = response.data.yqhtje;
          this.yszje = response.data.yszje;
        });
      }

    },
    nextCheck() {
      if (this.activeCheck++ > 2) this.activeCheck = 0;
    },
    nextspCheck() {
      /*if (this.activeCheck++ > 2) this.activeCheck = 0;
      this.form.state = this.approveStatus[0].dictValue;
      approvalMoney({budgetIds: this.ids}).then(response => {
        this.xhtje = response.data.xzhtje;
        this.yqhtje = response.data.yqhtje;
        this.yszje = response.data.yszje;
      });*/
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      let activeCheck = this.activeCheck + 1;
      if (activeCheck == 1) {
        this.activeCheck = 1;
        let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
        this.querypghzParams.parentBudgetId = budgetIds;
        this.getPghzLists();
      }
      if (activeCheck == 2) {
        this.activeCheck = 2;
        approvalMoney({budgetIds: budgetIds}).then(response => {
          this.xhtje = response.data.xzhtje;
          this.yqhtje = response.data.yqhtje;
          this.yszje = response.data.yszje;
        });
      }
      this.form.state = this.approveStatus[0].dictValue;
    },
    submitFormsp() {
      if (this.form.state == "3" && (this.form.by1 == "" || this.form.by1 == undefined || this.form.by1 == null)) {
        this.$message.warning("审核意见不可为空");
        return false;
      }
      let _this = this;
      let cityShow = this.cityShow;
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      approval({budgetIds: budgetIds, state: this.form.state, by1: this.form.by1}).then(response => {
        if (response.code == "200") {
          this.ids = [];
          this.openCheck = false;
          this.getList();
        } else {
          this.msgError(response.msg);
        }
      });
    },
    submitFormReject() {
      if ((this.form.by1 == "" || this.form.by1 == undefined || this.form.by1 == null)) {
        this.$message.warning("审核意见不可为空");
        return false;
      }

      approval({budgetIds: this.budgetIds, state: "3", by1: this.form.by1}).then(response => {

        if (response.code == "200") {
          this.ids = [];
          this.openCheckReject = false;
          this.getList();
        } else {
          this.msgError(response.msg);
        }
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.openCheck = false;
      this.openCheckReject = false;
      this.active = 0
      this.activeCheck = 0
      this.reset();
      this.pgList = [];
      this.ids = [];
      this.cityData = [];
      this.townData = [];
      this.townXianData = [];
      this.villageData = [];
      this.villageXianData = [];
    },
    cancelMy() {
      this.openBudget = false;
      this.active = 0;
      this.reset();
    },
    cancelCheck() {
      this.openCheck = false;
      this.openCheckReject = false;
      this.activeCheck = 0
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        budgetId: null,
        name: null,
        state: null,
        year: null,
        sdate: null,
        edate: null,
        budgetpersonid: null,
        budgetperson: null,
        budgetmoney: null,
        submittime: null,
        number: null,
        departmentCode: null,
        remarks: null,
        approvedperson: null,
        approveddate: null,
        createtime: null,
        by1: null,
        by2: null,
        by3: null
      };
      this.myform = {
        budgetId: null,
        name: null,
        year: null,
        sdate: null,
        edate: null,
        budgetpersonid: null,
        budgetperson: null,
        budgetmoney: null,
        submittime: null,
        number: null,
        departmentCode: null,
        remarks: null,
        state: "0",
        approvedperson: null,
        approveddate: null,
        createtime: null,
        totalMoney: null,
        by2: null,
        by3: null
      };
      this.resetForm("form");
      this.resetForm("myform");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams.year = "";
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handlePgQuery() {
      this.querypgParams.pageNum = 1;
      this.getPgList();
    },
    handleScpgQuery() {
      this.querypgParams.pageNum = 1;
      this.getScpgList();
    },
    /** 重置按钮操作 */
    resetShQuery() {
      this.queryShParams.cbfmc = "";
      this.queryShParams.departmentCode = "";
      this.deptCode = "";
      this.resetForm("queryShParams");
      this.handleShQuery();
    },
    handleShQuery() {
      this.queryShParams.pageNum = 1;
      this.queryShParams.departmentCode = this.deptCode;
      this.getApprovalList();
    },
    /** 重置按钮操作 */
    resetPgQuery() {
      this.querypgParams.cbfmc = "";
      this.querypgParams.departmentCode = "";
      this.resetForm("querypgForm");
      // this.handlePgQuery();
      this.handleScpgQuery();
    },

    handleDetailsQuery() {
      this.querybudgetFundsParams.departmentCode = this.deptCode;
      this.querybudgetFundsParams.pageNum = 1;
      this.getDetailsList();
    },
    /** 重置按钮操作 */
    resetDetailsQuery() {
      this.resetForm("querybudgetFundsForm");
      this.deptCode = "";
      this.handleDetailsQuery();
    },
    handleXianQuery() {
      this.querybudgetFundsParams.pageNum = 1;
      this.getDetailsListXian();
    },
    /** 重置按钮操作 */
    resetXianQuery() {
      this.resetForm("querybudgetFundsForm");
      this.querybudgetFundsParams.departmentCode = "";
      this.handleXianQuery();
    },
    handleQuQuery() {
      this.querybudgetFundsParams.pageNum = 1;
      this.getVillageMxList();
    },
    /** 重置按钮操作 */
    resetQuQuery() {
      this.resetForm("querybudgetFundsForm");
      this.querybudgetFundsParams.departmentCode = "";
      this.handleQuQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.budgetId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "新增";
      getNumber().then(response => {
        this.form.number = response.msg;
      });
      getInfo().then(response => {
        let deptCode = response.user.deptId;
        getDept(deptCode).then(response => {
          this.form.name = response.data.deptName + "预算退耕还淀";
        });
      });

      deptList().then(response => {
        this.villageData = response.data;
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.open = true
      this.title = "修改";
      this.reset();
      const id = row.budgetId;
      this.distributeId = id;
      this.ids = id;
      // 获取明细
      getBudgetFunds(id).then(response => {
        this.selectedBudgetDataStringIds = response.data.by5;
        this.selectedBudgetDataIds = response.data.by5.split(",");
        this.form.batchNumber = response.data.batchNumber;
        this.form.by4 = response.data.by4;
        this.form.by1 = response.data.by1;
        this.form.remark = response.data.remark;
        this.getSList();
      });
      // this.reset();
      // const id = row.id || this.ids
      // getBudgetFunds(id).then(response => {
      //   this.form = response.data;
      //   this.open = true;
      //   this.title = "修改";
      // });
    },
    /** 提交按钮 */
    submitForm() {
      if (this.pgList == [] || this.pgList == undefined) {
        this.$message.warning("没有数据");
        return false;
      }

      this.form.state = "0";
      if (this.form.budgetId != null) {
        this.form.regionCodes = this.villageSelectData;
        updateBudgetFunds(this.form).then(response => {
          this.msgSuccess("修改成功");
          this.open = false;
          this.getList();
          this.pgList = [];
        });
      } else {
        this.form.departmentCode = "";
        this.form.regionCodes = this.villageSelectData;
        addBudgetFunds(this.form).then(response => {
          this.msgSuccess("新增成功");
          this.open = false;
          this.getList();
          this.pgList = [];
        });
      }
    },
    submitBudgetFundsForm() {
      if (this.myform.totalMoney == "" || this.myform.totalMoney == null || this.myform.totalMoney == undefined) {
        this.$message.warning("未通过审核不能生成预算!");
        return false;
      }
      this.myform.state = "0";
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      this.myform.budgetIds = budgetIds;
      countyAdd(this.myform).then(response => {
        this.msgSuccess("操作成功");
        this.openBudget = false;
        this.getList();
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      this.openShjl = true
      const ids = row.budgetId || this.ids;
      this.$confirm('是否确认删除数据项?', "警告", {
        cancelButtonClass: 'btn-custom-cancel',
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return delBudgetFunds(ids);
      }).then(() => {
        this.getList();
        this.msgSuccess("删除成功");
      }).catch(() => {
      })
    },
    handleCheck() {
      this.openCheck = true;
      this.reset();
      //获取明细信息
      this.getApprovalList();
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      this.querypghzParams.parentBudgetId = budgetIds;
      this.getPghzLists();
      /*subApprovalList({budgetIds: this.ids}, this.queryShParams.pageNum, this.queryShParams.pageSize).then(response => {
        this.pgList = response.rows;
        this.pgtotal = response.total;
        this.loading = false;
      });*/
      getInfo().then(response => {
        let deptCode = response.user.dept.deptCode;
        this.deptCode = deptCode;
        if (deptCode.length == 4) {//新区
          this.cityShow = true;
          this.townShow = true;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.cityData = response.data;
          });
        } else if (deptCode.length == 6) {//县
          this.cityShow = false;
          this.townShow = true;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.townData = response.data;
          });
        } else if (deptCode.length == 9) {//镇
          this.cityShow = false;
          this.townShow = false;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.villageData = response.data;
          });
        } else {
          this.childlist(1306);
          this.cityShow = true;
          this.townShow = true;
          this.villageShow = true;
        }
      });
    },
    handleCheckReject(row) {
      this.querybudgetFundsParams.budgetId = row.budgetId;
      let budgetId = [];
      budgetId.push(row.budgetId);
      this.budgetIds = budgetId;
      this.openCheckReject = true;
      this.reset();
    },

    handlecbfDetails(row) {
      this.opencbfYsmx = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      //获取明细信息
      this.getDetailsList();
      getInfo().then(response => {
        let deptCode = response.user.dept.deptCode;

        if (deptCode.length == 4) {//新区
          this.cityShow = true;
          this.townShow = true;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.cityData = response.data;
          });
        } else if (deptCode.length == 6) {//县
          this.cityShow = false;
          this.townShow = true;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.townData = response.data;
          });
        } else if (deptCode.length == 9) {//镇
          this.cityShow = false;
          this.townShow = false;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.villageData = response.data;
          });
        } else if (deptCode.length == 12) {//村
          this.cityShow = false;
          this.townShow = false;
          this.villageShow = false;
        } else {
          this.childlist(1306);
          this.cityShow = true;
          this.townShow = true;
          this.villageShow = true;
        }
      });
    },

    handlecbfDetailsXian(row) {
      this.opencbfYsmxXian = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      //获取明细信息
      this.getDetailsListXian();
    },
    handlecbfDetailsQu(row) {
      this.opencbfYsmxQu = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      //获取明细信息
      this.getVillageMxList();
      let deptCode = row.departmentCode;

      if (deptCode.length == 4) {//新区
        this.cityShow = true;
        this.townShow = true;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.cityXianData = response.data;
        });
      } else if (deptCode.length == 6) {//县
        this.cityShow = false;
        this.townShow = true;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.townXianData = response.data;
        });
      } else if (deptCode.length == 9) {//镇
        this.cityShow = false;
        this.townShow = false;
        this.villageShow = true;
        childlistUse(deptCode).then(response => {
          this.villageXianData = response.data;
        });
      } else if (deptCode.length == 12) {//村
        this.cityShow = false;
        this.townShow = false;
        this.villageShow = false;
      } else {
        this.childlist(1306);
        this.cityShow = true;
        this.townShow = true;
        this.villageShow = true;
      }
    },
    handlecbfDetails1(row) {
      this.opencbfYsmx = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      //获取明细信息
      this.getDetailsList();
      getInfo().then(response => {
        let deptCode = response.user.dept.deptCode;

        if (deptCode.length == 4) {//新区
          this.cityShow = true;
          this.townShow = true;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.cityData = response.data;
          });
        } else if (deptCode.length == 6) {//县
          this.cityShow = false;
          this.townShow = true;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.townData = response.data;
          });
        } else if (deptCode.length == 9) {//镇
          this.cityShow = false;
          this.townShow = false;
          this.villageShow = true;
          childlistUse(deptCode).then(response => {
            this.villageData = response.data;
          });
        } else if (deptCode.length == 12) {//村
          this.cityShow = false;
          this.townShow = false;
          this.villageShow = false;
        } else {
          this.childlist(1306);
          this.cityShow = true;
          this.townShow = true;
          this.villageShow = true;
        }
      });
    },
    handleDetails(row) {
      this.openYsmx = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      //获取明细信息
      this.getDetailsList();
    },
    handleExamineRecord(row) {
      this.openShjl = true;
      this.querybudgetFundsParams.budgetId = row.budgetId;
      //获取明细信息
      approvalList({
        budgetId: row.budgetId,
        pageNum: this.queryRecordParams.pageNum,
        pageSize: this.queryRecordParams.pageSize
      }).then(response => {
        this.recordList = response.rows;
        this.recordtotal = response.total;
      });
    },
    getApprovalList() {
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      mxListByBudgetIds({
        budgetIds: budgetIds.toString(),
        pageNum: this.queryShParams.pageNum,
        pageSize: this.queryShParams.pageSize,
        cbfmc: this.queryShParams.cbfmc,
        departmentCode: this.queryShParams.departmentCode,
      }).then(response => {
        this.shList = response.rows;
        this.shtotal = response.total;
        this.loading = false;
      });
      /*subApprovalList({
        budgetIds: budgetIds,
        cbfmc: this.queryShParams.cbfmc,
        departmentCode: this.queryShParams.departmentCode
      }, this.queryShParams.pageNum, this.queryShParams.pageSize).then(response => {
        this.shList = response.rows;
        this.shtotal = response.total;
        this.loading = false;
      });*/
    },
    getRecordList() {
      approvalList({
        budgetId: this.querybudgetFundsParams.budgetId,
        pageNum: this.queryRecordParams.pageNum,
        pageSize: this.queryRecordParams.pageSize
      }).then(response => {
        this.recordList = response.rows;
        this.recordtotal = response.total;
      });
    },
    handleBudget() {
      this.reset();
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      let years = this.$refs.multipleTable.selection.map(item => item.year);
      let year = '';
      let iscon = false;
      let i = 0;
      years.forEach(item => {
        i = i + 1;
        if (year == '') {
          year = item;
          // iscon = true;
        } else if (item > year) {
          // this.$message.warning("不允许生成不同年份的数据预算");
          // iscon = false;
          year=item;
        }
        if (i == years.length) {
          this.budgetIds = budgetIds;
          countyMoney({budgetIds: budgetIds}).then(response => {
            if (response.code == "500") {
              return false;
            }
            this.myform.totalMoney = response.data.yszje;
          });

          this.openBudget = true;
          this.title = "生成预算";
          // this.myform.year = this.queryParams.year;
          this.myform.year = year;

          getNumber().then(response => {
            this.myform.number = response.msg;
          });
          getInfo().then(response => {
            // deptCode = response.user.dept.deptCode;
            let deptCode = response.user.dept.deptCode;
            this.deptCode = deptCode;
            if (deptCode.length == 4) {//新区
              this.cityShow = true;
              this.townShow = true;
              this.villageShow = true;
              childlistUse(deptCode).then(response => {
                this.cityData = response.data;
              });
            } else if (deptCode.length == 6) {//县
              this.cityShow = false;
              this.townShow = true;
              this.villageShow = true;
              childlistUse(deptCode).then(response => {
                this.townData = response.data;
              });
            } else if (deptCode.length == 9) {//镇
              this.cityShow = false;
              this.townShow = false;
              this.villageShow = true;
              childlistUse(deptCode).then(response => {
                this.villageData = response.data;
              });
            } else if (deptCode.length == 12) {//村
              this.cityShow = false;
              this.townShow = false;
              this.villageShow = false;
            } else {
              this.childlist(1306);
              this.cityShow = true;
              this.townShow = true;
              this.villageShow = true;
            }

            let deptId = response.user.deptId;
            getDept(deptId).then(response => {
              this.myform.name = this.myform.year + "年" + response.data.deptName + "退耕还淀预算";
            });
          });
        }
      })

    },
    handleMyBudget() {
      this.openMyBudget = true;
      this.getMyList();
    },
    /** 导出按钮操作 */
    handleExport() {
      let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      let _this = this;
      this.$confirm('是否确认导出?', "警告", {
        cancelButtonClass: 'btn-custom-cancel',
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        _this.newloading = _this.$loading({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });
        return exportList({year: _this.queryParams.year,name:_this.queryParams.name,states:'1,2'});
      }).then(response => {
        _this.newloading.close();
        this.download(response.msg);
      }).catch(() => {
      })
    },
    handleDetailsExport() {
      // let budgetIds = this.$refs.multipleTable.selection.map(item => item.budgetId);
      let budgetIds = this.querypghzParams.parentBudgetId;
      let _this = this;
      this.$confirm('是否确认导出?', "警告", {
        cancelButtonClass: 'btn-custom-cancel',
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        _this.newloading = _this.$loading({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });
        return exportMxList({budgetIds: budgetIds.toString()});
      }).then(response => {
        _this.newloading.close();
        this.download(response.msg);
      }).catch(() => {
      })
    }
  }
};
</script>
<style>
.btn-custom-cancel {
  float: right;
  margin-left: 10px;
}

.selectedDv {
  background-color: rgba(230, 247, 255, 1);
  box-sizing: border-box;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(186, 231, 255, 1);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
}

.statusDv {
  display: flex;
  justify-content: center;
  align-items: center;
}

.statudPoint {
  border-radius: 50px;
  width: 6px;
  height: 6px;
  margin-right: 6px;
}

/*审核通过背景色*/
.Bg2 {
  background-color: #13ce66;
}

/*未提交*/
.Bg0 {
  background-color: #1890ff;
}

/*待审核*/
.Bg1 {
  background-color: orange;
}

/*审核失败*/
.Bg3 {
  background-color: red;
}
</style>
